import re

target_str = '99There are 6 classer in the computer science major, with 30 students in each class.'
# target_str = 'There are  classer in the computer science major, with  students in each class.'
pattern = r'\d+'

result1 = re.findall(pattern, target_str)
print(result1)

result2 = re.search(pattern, target_str)
print(result2)
# print(result2.group())

result3 = re.match(pattern, target_str)
print(result3)
print(result3.group())

